import request from '/@/request/https'
import { AxiosPromise } from 'axios'

export interface submitParam {
    credential: string
}
export interface moduleInfo {
    id: string,
    userId: string,
    type: string, 
    modelEntryTime:string,
    modelExitTime: string,
    modelName:string, 
    phoneSystem:string
}
export function RInform(taskNo:string):AxiosPromise { // 获取告知页的地址
    return request({
        url: `/v2/home/info/${taskNo}`,
        method: 'get'
    }) 
}
export function RStatementInfo(statementId:string):AxiosPromise { // 获取授权页面的协议信息
    return request({
        url: `/v2/statement/info/${statementId}`,
        method: 'get'
    }) 
}

export function RAcceptance(params:object):AxiosPromise { // 同意授权页面的协议
    return request({
        url: `/v2/statement/acceptance`,
        method: 'post',
        data:params
    }) 
}
export function RAuthorization(taskCode:string,path:string):AxiosPromise { // 入口认证从定向接口
    return request({
        url: `/review/v2/authorization?taskCode=${taskCode}&path=${path}`,
        method: 'post'
    }) 
}
export function RLogFace(taskNo:string):AxiosPromise { // 人脸之后的日志接口
    return request({
        url: `/review/v2/customer/log/face/${taskNo}`,
        method: 'post'
    }) 
} 
export function stateNotification(taskNo:string):AxiosPromise { // 人脸之后的日志接口
    return request({
        url: `/v2/customer/stateNotification`,
        method: 'post',
        data: {
            taskCode: taskNo
        }
    }) 
} 
// export function list(taskNo:string):AxiosPromise { // 获取保单检视列表接口
//     return request({
//         url: `/v2/insurance/list?taskNo=${taskNo}`,
//         // url: `${import.meta.env.VITE_APP_API_URL || ''}certificate/qr`,
//         method: 'get'
//     }) 
// }
export function list(params:any):AxiosPromise { // 获取保单检视列表接口
    return request({
        url: `/v2/insurance/list`,
        // url: `${import.meta.env.VITE_APP_API_URL || ''}certificate/qr`,
        method: 'post',
        data: 
            params
        
    }) 
}
export function report(params:any):AxiosPromise { // 获取生成报告的接口地址
    return request({
        url: `/v2/insurance/report`,
        // url: `${import.meta.env.VITE_APP_API_URL || ''}certificate/qr`,
        method: 'post',
        data: {
           ...params
        }
    }) 
}

